#include "stdafx.h"

#include "CPU.h"

SharpSDL::ManagedSDL::CPU::CPU(void)
{
	if (SDL_HasRDTSC() == SDL_TRUE)
		RDTSC = CPUFeature::Present;
	else
		RDTSC = CPUFeature::Absent;

	if (SDL_HasMMX() == SDL_TRUE)
		MMX = CPUFeature::Present;
	else
		MMX = CPUFeature::Absent;

	if (SDL_HasMMXExt() == SDL_TRUE)
		MMXExt = CPUFeature::Present;
	else
		MMXExt = CPUFeature::Absent;

	if (SDL_Has3DNow() == SDL_TRUE)
		Now3D = CPUFeature::Present;
	else
		Now3D = CPUFeature::Absent;

	if (SDL_Has3DNowExt() == SDL_TRUE)
		Now3DExt = CPUFeature::Present;
	else
		Now3DExt = CPUFeature::Absent;

	if (SDL_HasSSE() == SDL_TRUE)
		SSE = CPUFeature::Present;
	else
		SSE = CPUFeature::Absent;

	if (SDL_HasSSE2() == SDL_TRUE)
		SSE2 = CPUFeature::Present;
	else
		SSE2 = CPUFeature::Absent;

	if (SDL_HasAltiVec() == SDL_TRUE)
		AltiVec = CPUFeature::Present;
	else
		AltiVec = CPUFeature::Absent;
}

SharpSDL::ManagedSDL::CPU::CPUFeature SharpSDL::ManagedSDL::CPU::MMXSupport(void)
{
	return MMX;
}

SharpSDL::ManagedSDL::CPU::CPUFeature SharpSDL::ManagedSDL::CPU::RDTSCSupport(void)
{
	return RDTSC;
}

SharpSDL::ManagedSDL::CPU::CPUFeature SharpSDL::ManagedSDL::CPU::Now3DSupport(void)
{
	return Now3D;
}

SharpSDL::ManagedSDL::CPU::CPUFeature SharpSDL::ManagedSDL::CPU::MMXExtSupport(void)
{
	return MMXExt;
}

SharpSDL::ManagedSDL::CPU::CPUFeature SharpSDL::ManagedSDL::CPU::Now3DExtSupport(void)
{
	return Now3DExt;
}

SharpSDL::ManagedSDL::CPU::CPUFeature SharpSDL::ManagedSDL::CPU::SSESupport(void)
{
	return SSE;
}

SharpSDL::ManagedSDL::CPU::CPUFeature SharpSDL::ManagedSDL::CPU::SSE2Support(void)
{
	return SSE2;
}

SharpSDL::ManagedSDL::CPU::CPUFeature SharpSDL::ManagedSDL::CPU::AltiVecSupport(void)
{
	return AltiVec;
}